/**
 * 验证银行卡
 * @param rule
 * @param value
 * @param callback
 */
export function validateBankCard (rule, value, callback){
    const strBin = '10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99'
    if (!value) {
        return
    } else if (value.trim().length < 12 || value.trim().length > 19) {
        callback(new Error('银行卡号长度必须在12到19之间'))
    } else if (strBin.indexOf(value.substring(0, 2)) === -1) {
        callback(new Error('银行卡号开头6位不符合规范'))
    } else {
        callback()
    }
}
